﻿
CREATE proc [dbo].[proc_InOutSide_CheckInOut_GetItem]
(
	@id int
)
as
	select 
		id,
		CompanyId,
		CustomerId,
		(select CustomerName from Customer where Customer.CustomerId=CheckInOut.CustomerId) as Customer,
		ContactPerson,
		ContactTel, 
		Address,
		MainProjectId,
		(Select Title From OProject Where Id=CheckInOut.MainProjectId) As MainProject,
		Content,
		Aim,
		Accompany,
		(Select Top 1 EName From [Employee] Where [Employee].UserName=CheckInOut.UserName) As UserName,
		IsNull(CheckInTime,'') As CheckInTime,
		CheckOutTime 
		From  CheckInOut Where id=@id